# Acquire AppSealing device unique identifier_Xamarin
AppSealing SDK generates and manages unique identifier for each device. Customer who use the AppSealing SDK can use the interface of AppSealing to verify the device unique identifier, if necessary. And can be used for the business using the hacking data service provided by AppSealing.
# Show acquire device unique identifier
Open the “ViewController.cs” file of your project and insert the following code. If you already have a 'ViewDidAppear' method in your ViewController.cs file, insert after 'base.ViewDidAppear ( animated );' line.
Simple UI code into ‘ViewController.cs’ for Xamarin project
public partial class ViewController : UIViewController
{
[System.Runtime.InteropServices.DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)]
extern static public int Unity_GetAppSealingDeviceID(StringBuilder deviceIDBuffer);
...
...
public override void ViewDidAppear (bool animated)
{
base.ViewDidAppear( animated );
StringBuilder appSealingDeviceID = new StringBuilder(64);
int result = Unity_GetAppSealingDeviceID(appSealingDeviceID);
if (result == 0)
{
string strAppSealingDeviceID = appSealingDeviceID.ToString();
System.Console.WriteLine("AppSealing DeviceID: " + strAppSealingDeviceID);
var okAlertController = UIAlertController.Create( "AppSealing DeviceID", strAppSealingDeviceID,
UIAlertControllerStyle.Alert );
okAlertController.AddAction (UIAlertAction.Create ("OK", UIAlertActionStyle.Default, null));
PresentViewController( okAlertController, true, null );
}
}
}
Your app will show simple alert box like